/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "far_stock")
@NamedQueries({
    @NamedQuery(name = "FarStock.findAll", query = "SELECT f FROM FarStock f")})
public class FarStock implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "fsk_id")
    private Integer fskId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "fsk_cantidad")
    private BigDecimal fskCantidad;
    @Column(name = "fsk_valor")
    private BigDecimal fskValor;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fsk_estado")
    private int fskEstado;
    @Column(name = "fsk_tipo")
    private Integer fskTipo;
    @OneToMany(mappedBy = "farStock", fetch = FetchType.LAZY)
    private List<FarTransferenciaDetalle> farTransferenciaDetalleList;
    @OneToMany(mappedBy = "farStock", fetch = FetchType.LAZY)
    private List<FarRecetaDetalle> farRecetaDetalleList;
    @JoinColumn(name = "fid_id", referencedColumnName = "fid_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarIngresoMedicamentoDetalle farIngresoMedicamentoDetalle;
    @JoinColumn(name = "fbo_id", referencedColumnName = "fbo_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarBodega farBodega;
    @OneToMany(mappedBy = "farStock", fetch = FetchType.LAZY)
    private List<FarEgresoDetalle> farEgresoDetalleList;
    @OneToMany(mappedBy = "farStock", fetch = FetchType.LAZY)
    private List<FarDevolucionesDetalle> farDevolucionesDetalleList;

    public FarStock() {
    }

    public FarStock(Integer fskId) {
        this.fskId = fskId;
    }

    public FarStock(Integer fskId, BigDecimal fskCantidad, int fskEstado) {
        this.fskId = fskId;
        this.fskCantidad = fskCantidad;
        this.fskEstado = fskEstado;
    }

    public Integer getFskId() {
        return fskId;
    }

    public void setFskId(Integer fskId) {
        this.fskId = fskId;
    }

    public BigDecimal getFskCantidad() {
        return fskCantidad;
    }

    public void setFskCantidad(BigDecimal fskCantidad) {
        this.fskCantidad = fskCantidad;
    }

    public BigDecimal getFskValor() {
        return fskValor;
    }

    public void setFskValor(BigDecimal fskValor) {
        this.fskValor = fskValor;
    }

    public int getFskEstado() {
        return fskEstado;
    }

    public void setFskEstado(int fskEstado) {
        this.fskEstado = fskEstado;
    }

    public Integer getFskTipo() {
        return fskTipo;
    }

    public void setFskTipo(Integer fskTipo) {
        this.fskTipo = fskTipo;
    }

    public List<FarTransferenciaDetalle> getFarTransferenciaDetalleList() {
        return farTransferenciaDetalleList;
    }

    public void setFarTransferenciaDetalleList(List<FarTransferenciaDetalle> farTransferenciaDetalleList) {
        this.farTransferenciaDetalleList = farTransferenciaDetalleList;
    }

    public List<FarRecetaDetalle> getFarRecetaDetalleList() {
        return farRecetaDetalleList;
    }

    public void setFarRecetaDetalleList(List<FarRecetaDetalle> farRecetaDetalleList) {
        this.farRecetaDetalleList = farRecetaDetalleList;
    }

    public FarIngresoMedicamentoDetalle getFarIngresoMedicamentoDetalle() {
        return farIngresoMedicamentoDetalle;
    }

    public void setFarIngresoMedicamentoDetalle(FarIngresoMedicamentoDetalle farIngresoMedicamentoDetalle) {
        this.farIngresoMedicamentoDetalle = farIngresoMedicamentoDetalle;
    }

    public FarBodega getFarBodega() {
        return farBodega;
    }

    public void setFarBodega(FarBodega farBodega) {
        this.farBodega = farBodega;
    }

    public List<FarEgresoDetalle> getFarEgresoDetalleList() {
        return farEgresoDetalleList;
    }

    public void setFarEgresoDetalleList(List<FarEgresoDetalle> farEgresoDetalleList) {
        this.farEgresoDetalleList = farEgresoDetalleList;
    }

    public List<FarDevolucionesDetalle> getFarDevolucionesDetalleList() {
        return farDevolucionesDetalleList;
    }

    public void setFarDevolucionesDetalleList(List<FarDevolucionesDetalle> farDevolucionesDetalleList) {
        this.farDevolucionesDetalleList = farDevolucionesDetalleList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fskId != null ? fskId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FarStock)) {
            return false;
        }
        FarStock other = (FarStock) object;
        if ((this.fskId == null && other.fskId != null) || (this.fskId != null && !this.fskId.equals(other.fskId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.FarStock[ fskId=" + fskId + " ]";
    }
    
}
